
package com.fx.apartment.modules.house.wrapper;

import com.fx.apartment.modules.house.entity.Visitor;
import com.fx.apartment.modules.house.vo.VisitorVO;
import com.fx.apartment.common.support.BaseEntityWrapper;
import com.fx.apartment.common.tool.utils.BeanUtil;

import java.util.Objects;

/**
 * 访客管理包装类,返回视图层所需的字段
 *
 * @author QinXueFeng
 * @since 2021-04-19
 */
public class VisitorWrapper extends BaseEntityWrapper<Visitor, VisitorVO> {

	public static VisitorWrapper build() {
		return new VisitorWrapper();
 	}

	@Override
	public VisitorVO entityVO(Visitor visitor) {
		VisitorVO visitorVO = Objects.requireNonNull(BeanUtil.copy(visitor, VisitorVO.class));

		//User createUser = UserCache.getUser(visitor.getCreateUser());
		//User updateUser = UserCache.getUser(visitor.getUpdateUser());
		//visitorVO.setCreateUserName(createUser.getName());
		//visitorVO.setUpdateUserName(updateUser.getName());

		return visitorVO;
	}

}
